import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

export default {
  getByKnowledge: async (knowledgeCode: string) => {
    return await prisma.question.findMany({
      where: { knowledge_code: knowledgeCode }
    });
  },
  
  // 暂时保留空方法保持接口兼容
  generate: async (questionData: any) => {
    return questionData;
  },
  
  getById: async (id: string) => {
    return await prisma.question.findUnique({
      where: { id: parseInt(id) }
    });
  }
};